//文章分类模块
//导入相关模块
const express = require('express');
const router = express.Router();

//导入文章分类的处理函数
const artCate_handler = require('../router_handler/artcate')

//验证数据
const expressJoi = require('@escook/express-joi')
const { add_Cate_Schema, delete_Cate_Schema, get_Cate_Schema, update_Cate_Schema } = require('../schema/artacte');

//获取文章分类列表
router.get('/cates', artCate_handler.getArtCates);
//添加文章分类
router.post('/addcates', expressJoi(add_Cate_Schema), artCate_handler.addArtCates);
//删除文章数据
router.get('/deletecate/:id', expressJoi(delete_Cate_Schema), artCate_handler.deleteCateById);
//根据ID获取文章分类的功能
router.get('/cates/:id', expressJoi(get_Cate_Schema), artCate_handler.getArtCateById);
//根据ID更新文章分类的功能
router.post('/updatecate', expressJoi(update_Cate_Schema), artCate_handler.updateCateById);


module.exports = router;